//
//  MainViewController.m
//  GentlemanAnime
//
//  Created by dlios on 15-7-4.
//  Copyright (c) 2015年 lanou3g.com 蓝欧科技. All rights reserved.
//

#import "MainViewController.h"
#import "AnimeViewController.h"
#import "NewsViewController.h"
#import "ImageViewController.h"

@interface MainViewController ()

@end

@implementation MainViewController
- (void)dealloc {
    [_tabBC release];
    [super dealloc];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor redColor];
    // 漫画
    AnimeViewController *animeVC = [[AnimeViewController alloc] init];
    animeVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"漫画" image:[UIImage imageNamed:@"iconfont-shu"] tag:101];
    animeVC.navigationItem.title = @"漫画";
    UINavigationController *animeNaVC = [[UINavigationController alloc] initWithRootViewController:animeVC];
    animeNaVC.navigationBar.barTintColor = [UIColor colorWithRed:0.334 green:0.619 blue:1.000 alpha:1.000];
    animeNaVC.navigationBar.tintColor = [UIColor whiteColor];
    
    // 漫资讯
    NewsViewController *newsVC = [[NewsViewController alloc] init];
    newsVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"漫资讯" image:[UIImage imageNamed:@"iconfont-xingyexinwen"] tag:102];
    newsVC.navigationItem.title = @"漫资讯";
    UINavigationController *newsNaVC = [[UINavigationController alloc] initWithRootViewController:newsVC];
    newsNaVC.navigationBar.barTintColor = [UIColor colorWithRed:0.334 green:0.619 blue:1.000 alpha:1.000];
    newsNaVC.navigationBar.tintColor = [UIColor whiteColor];
    // 漫图
    ImageViewController *imageVC = [[ImageViewController alloc] init];
    imageVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"漫图" image:[UIImage imageNamed:@"iconfont-tupian"] tag:103];
    imageVC.navigationItem.title = @"漫图";
    UINavigationController *imageNaVC = [[UINavigationController alloc] initWithRootViewController:imageVC];
    imageNaVC.navigationBar.barTintColor = [UIColor colorWithRed:0.334 green:0.619 blue:1.000 alpha:1.000];
    imageNaVC.navigationBar.tintColor = [UIColor whiteColor];
    
    self.tabBC = [[UITabBarController alloc] init];
    self.tabBC.viewControllers = [NSArray arrayWithObjects:animeNaVC,newsNaVC,imageNaVC, nil];
    self.tabBC.tabBar.barTintColor = [UIColor colorWithWhite:0.930 alpha:1.000];
    self.tabBC.tabBar.tintColor = [UIColor colorWithRed:0.334 green:0.619 blue:1.000 alpha:1.000];
    [self addChildViewController:self.tabBC];
    [self.view addSubview:self.tabBC.view];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
